package com.lagou.springbootwork.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @ClassName Article
 * @Deseription 文章
 * @Author fx
 * @Date 2020/11/29 0029 10:04
 * @Version 1.0
 **/
public class Article {

    //文章ID
    private Integer id;
    //文章标题
    private String title;
    //文章内容
    private String content;
    //文章发布时间
    private Date created;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getCreated() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:MM:SS");
        return simpleDateFormat.format(created);
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    @Override
    public String toString() {
        return "Article{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                '}';
    }
}
